
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
//These two imports come from the classes111.zip
import oracle.sql.*;
import oracle.jdbc.driver.*;
//import java.text.Format;
import java.text.*;


public class DBOpsTests
{

	public static DBOps dbops = new DBOps();


	// test addSurveyQuestion
	public static void TaddSurveyQuestion()
	{
		Question q = new Question();
		q.setContent("What are your thoughts on the J.F.K. assassination?");
		q.setType(3);
		//q.possibleAns = new String[] {"really angry", "somewhat angry", "angry", "not angry", "very happy"};

		dbops.addSurveyQuestion(2, 13, q);
	}


	// test getCourses
	public static void TgetCourses()
	{
		dbops.USERID = 2;
		dbops.getCourses(2);
	}

	public static void TsubmitSurvey()
	{
		dbops.USERID = 2;
		Response r = new Response("not angry", 35);
		Response[] responses = new Response[1];
		responses[0] = r;
		dbops.submitSurvey(2, 10, responses);
	}


	public static void TgetSurveyResults()
	{
		Response[] results = dbops.getSurveyResults(10);
		for(int i = 0; i < results.length; i++)
		{
			System.out.println("Result " + i + ":");
			System.out.println(results[i].id + " | " + results[i].resp);
		}
	}

	public static void TgetDate()
	{
		java.util.Date D = dbops.getDate(1);
		System.out.println(D);

	}


	public static void main(String args[])
	{


		//dbops.validateUser("dac61", "bagel");

		//dbops.getSurveyQuestions(10);

		//TsubmitSurvey();

		//TgetSurveyResults();

		//TgetCourses();

		  // USE FORMAT BELOW FOR ENTERING DATES
		  //java.sql.Date jsqlD = java.sql.Date.valueOf("15-JUL-09");

		//TgetDate();




	}




}